#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
//#define int long long
const int N = 2e2 + 22;
set<int> adj[N];
vector<pair<int, int>> j;
int n, m, deg[N], t, ans;
void ip() {
cin >> n >> m;
for (int i = 0; i < m; i++) {
int v, u;
cin >> v >> u;
deg[v]++;
deg[u]++;
adj[v].insert(u);
adj[u].insert(v);
}
}
void ch() {
for (int i = 1; i <= n; i++) {
if (deg[i] % 2 == 0)
ans++;
else {
adj[i].insert(N - 2);
adj[N - 2].insert(i);
}
}
}
void euler(int v, int p) {
adj[v].erase(p);
while(!adj[v].empty()) {
int u = *adj[v].begin();
adj[v].erase(u);
j.push_back({v, u});
euler(u, v);
}
}
void op() {
cout << ans << endl;
for (auto i : j) {
int v = i.first, u = i.second;
if (v != N - 2 && u != N - 2)
cout << v << " " << u << endl;
}
}
void uwu() {
ans = 0;
j.clear();
for (int i = 0; i <= n; i++) {
deg[i] = 0;
adj[i].clear();
}
}
void run() {
ip();
ch();
for (int i = 0; i <= n; i++)
if (!adj[i].empty())
euler(i, 0);
op();
uwu();
}
signed main(){
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> t;
while (t--) {
run();
}
}
34. Find First and Last Position of Element in Sorted Array | 33. Search in Rotated Sorted Array |
17. Letter Combinations of a Phone Number | 5. Longest Palindromic Substring |
3. Longest Substring Without Repeating Characters | 1312. Minimum Insertion Steps to Make a String Palindrome |
1092. Shortest Common Supersequence | 1044. Longest Duplicate Substring |
1032. Stream of Characters | 987. Vertical Order Traversal of a Binary Tree |
952. Largest Component Size by Common Factor | 212. Word Search II |
174. Dungeon Game | 127. Word Ladder |
123. Best Time to Buy and Sell Stock III | 85. Maximal Rectangle |
84. Largest Rectangle in Histogram | 60. Permutation Sequence |
42. Trapping Rain Water | 32. Longest Valid Parentheses |
Cutting a material | Bubble Sort |
Number of triangles | AND path in a binary tree |
Factorial equations | Removal of vertices |
Happy segments | Cyclic shifts |
Zoos | Build a graph |